package itcz.example.pattern.structure_type.combination;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: Menu
 * @Author: ITCZ
 * @Date: 2025-08-20
 * @Description: 组合模式-叶子
 */
public class MenuItem extends MenuComponent {

    public MenuItem(String name, int level) {
        this.name = name;
        this.level = level;
    }

    @Override
    public void print() {
        for (int i = 1; i < level; i++) {
            System.out.print("--");
        }
        System.out.println(name);
    }
}
